package service.File;

import dao.User.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import pojo.FileInformation;

import javax.annotation.Resource;
import java.util.Map;

@Service("fileService")
public class FileServiceImpl implements FileService {
    @Resource
    private dao.File.FileMapper fileMapper;

    @Override
    public void createFile(FileInformation fileInformation) {
        fileMapper.createFile(fileInformation);
    }

    @Override
    public void deleteFile(int fileid) {
        fileMapper.deleteFile(fileid);
    }

    @Override
    public FileInformation getFile(int fileid) {
        return fileMapper.getFile(fileid);
    }

    @Override
    public void reviseFileLabel(int fileid, String label) {
        Map<String,String> map=Map.of(
                "fileId",String.valueOf(fileid),
                "Label",label
        );
        fileMapper.reviseFileLabel(map);
    }
}
